package com.example.administrator.social.util;


import com.example.administrator.social.model.MessageData;
import com.example.administrator.social.model.User;

import java.util.Comparator;

/**
 * Created by Administrator on 2018/9/10 0010.
 */

public class PinyinComparator implements Comparator<MessageData> {

    public int compare(MessageData o1, MessageData o2) {
        if (o1.getLetters().equals("@")
                || o2.getLetters().equals("#")) {
            return -1;
        } else if (o1.getLetters().equals("#")
                || o2.getLetters().equals("@")) {
            return 1;
        } else {
            return o1.getLetters().compareTo(o2.getLetters());
        }
    }

}
